package com.hzsai.mininote.controller;

import com.hzsai.mininote.common.I18nPool;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

/**
 * hzsai 2020/1/16
 * usage:
 **/
@Api(tags = "语言控制器")
@RestController
public class I18nPoolTestController {

    @Autowired
    I18nPool pool = null;

    @RequestMapping(value = "/i18n/{word}", method = {RequestMethod.GET})
    public String translate(@PathVariable("word") @Valid @NotNull String word) {
        return I18nPool.getWord(word);
    }
}
